// MagnifierWindow.h

#ifndef MAGNIFIERWINDOW_H
#define MAGNIFIERWINDOW_H

#include <QWidget>
#include <QTimer>
#include <QScreen>
#include <QPixmap>


/**
 * @brief The MagnifierWindow class
 * 放大镜窗口
 */


class MagnifierWindow : public QWidget
{
    Q_OBJECT

public:
    explicit MagnifierWindow(QWidget *parent = nullptr, qreal value = 4.0);
    ~MagnifierWindow();

protected:
    void paintEvent(QPaintEvent *event) override;
    void mouseMoveEvent(QMouseEvent *event) override;

private slots:
    void updateMagnifier();

private:
    QPixmap fullScreenPixmap;
    QSize magnifierSize;
    QPoint magnifierPosition;
    QTimer *updateTimer;
    qreal zoomFactor;

    void setupUI();
};

#endif // MAGNIFIERWINDOW_H
